﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="edit_user.aspx.cs" Inherits="background.Manager.Users.edit_user" %>

<!DOCTYPE html>
<% System.Data.DataRow i= ManagerConfig.getUserInfo(Request["id"]).Rows[0]; %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="../Styles/index.css" rel="stylesheet" />
    <script src="../Scripts/jquery-1.8.2.min.js"></script>
    <script src="../Scripts/layer/layer.js"></script>
    <script type="text/javascript">if (<%=(Session[ManagerConfig.bg("sessionName")]==null).ToString().ToLower()%>) { window.parent.location = '../login.aspx'; }</script>
    <script type="text/javascript">
        function submit_editUser() {
            var nk = $("#nickname");
            if ($.trim(nk.val()).length == 0) { layer.msg("请输入昵称"); nk.focus(); return; }
            $.post("../Action/fromData.ashx", { action: "updateInfo", nickname: nk.val(),  id:"<%=Request["id"]%>" }, function (ret) {
                if (ret=="true") {
                    layer.msg("恭喜您更新成功", { icon: 1, time: 2000 }, function () { 
                        window.location.href = "user_list.aspx";
                    })
                } else {
                    layer.msg("对不起用户更新失败", { icon: 2, time: 2000 })
                }
            })
        }
    </script>
</head>
<body>
    <div class="top">
        <strong>编辑管理员</strong>
        <span style="float: right"><a href="javascript:history.back();">
            <img src="../Images/bak.png" />后退</a></span>
    </div>
    <div class="main">
        <!--表单提交-->
        <div>
            <table border="0" cellpadding="0" cellspacing="0" class="table">
                <tr>
                    <th>用户昵称</th>
                    <td>
                        <input type="text" id="nickname" class="text" value="<%=i["nickname"] %>" /><i>*</i></td>
                </tr>
                <tr>
                    <th>登录帐号</th>
                    <td>
                        <input type="text" id="loginname" class="text" value="<%=i["loginname"] %>" style="cursor:not-allowed" disabled="disabled" /></td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <input type="button" class="sbtn" value="更新" onclick="submit_editUser()" /></td>
                </tr>
            </table>
        </div>
    </div>
    <!--#include file='../Include/footer.html'-->
</body>
</html>
